package com.training.java.core.collections.laptop.pre15;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class LaptopDemo {

	public static void main(String[] args) {

		Laptop laptop1 = new Laptop("Sony", "Vaio", "Windows7");
		Laptop laptop2 = new Laptop("Toshiba", "Satellite", "Windows8");
		Laptop laptop3 = new Laptop("Apple", "MacBook Pro", "Mac-os");
		
       List laptops = new ArrayList();
		
       laptops.add(laptop1);
       laptops.add(laptop2);
       laptops.add(laptop3);
		
		Iterator laptopsIterator = laptops.iterator();
		
		while(laptopsIterator.hasNext())
		{
			Laptop alaptop =(Laptop) laptopsIterator.next();
			System.out.println("Make is " + alaptop.getMake());
			System.out.println("Model is " + alaptop.getModel());
			System.out.println("Operating system is " + alaptop.getOperatingSystem());
			System.out.println("*************************");
		}
	}

}
